package lock;

/**
 * @Author: Yangu
 * @Created time: 2020/11/11 17:24
 * @Description :
 */
public class ThreadA extends Thread {

    private Object lock;

    public ThreadA(Object lock) {
        this.lock = lock;
    }

    @Override
    public void run() {
        synchronized (lock) {
            try {
                System.out.println("ThreadA start");
                lock.wait();
                System.out.println("ThreadA end");

            } catch (Exception e) {
                e.printStackTrace();
            }
        }

    }
}
